import time
import requests

def pull_model_manifest_with_retries(url, max_retries=100):
    for attempt in range(max_retries):
        try:
            response = requests.get(url)
            return response
        except requests.exceptions.ConnectionError as e:
            print(f"第 {attempt + 1} 次尝试失败: {e}")
            time.sleep(2 ** attempt)  # 指数退避
    raise Exception("已达到最大重试次数")

url = "https://registry.ollama.ai/v2/library/deepseek-r1/manifests/1.5b"
pull_model_manifest_with_retries(url)